package myJs.myPkg.highcharts

import myJs.myPkg.jquery.JQuery
import myJs.myPkg.jsext._

import scala.scalajs.js
import scala.language.implicitConversions
import scala.scalajs.js.JSConverters._
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.annotation.JSImport.Namespace

/**
 * Created by yz on 2019/3/14
 */

object HighchartsConfig extends HighchartsConfigBuilder(noOpts)

class HighchartsConfigBuilder(val dict: OptMap) extends JSOptionBuilder[HighchartsConfig, HighchartsConfigBuilder](new HighchartsConfigBuilder(_)) {

  def chart(v: Chart) = jsOpt("chart", v)

  def title(v: Title) = jsOpt("title", v)

  def subtitle(v: Title) = jsOpt("subtitle", v)

  def mapNavigation(v: MapNavigation) = jsOpt("mapNavigation", v)

  def series(v: js.Array[SeriesBuilder]) = {
    val fmtV = v.map(_.dict.toJSDictionary)
    jsOpt("series", fmtV)
  }


  def credits(v: Credits) = jsOpt("credits", v)

  def colorAxis(v: ColorAxis) = jsOpt("colorAxis", v)

}

trait HighchartsConfig extends js.Object {

}
